package com.maiji.cloud.entities.manager;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;

@NoArgsConstructor
@Data
@Accessors(chain=true)
@Table(name = "menu")
public class Menu implements Serializable {

    @TableId
    @Column(name = "uu_id", type = MySqlTypeConstant.VARCHAR, length = 50, isKey = true)
    private Long uuId;

    @Column(name = "url", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String url;

    @Column(name = "path", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String path;

    @Column(name = "component", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String component;

    @Column(name = "name", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String name;

    @Column(name = "icon", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String icon;

    @Column(name = "parent_id", type = MySqlTypeConstant.VARCHAR, length = 50)
    private Long parentId;

    @Column(name = "keep_alive", type = MySqlTypeConstant.BIT, length = 1)
    private Boolean keepAlive; // 是否缓存组件，0-否，1-是

    @Column(name = "require_auth", type = MySqlTypeConstant.BIT, length = 1)
    private Boolean requireAuth; // 是否需要权限，0-否，1-是

    @Column(name = "enabled", type = MySqlTypeConstant.BIT, length = 1)
    private Boolean enabled; // 是否可用，0-否，1-是

    @TableField(exist = false)
    private List<Role> roles;

    @TableField(exist = false)
    private List<Menu> childrens;

}
